import FCVector

MAX_LEAF_SIZE = 10
RVO_EPSILON = 0.00001
loddist = [0,0,0]
arrangecube = [[FCVector.vector2D(0,0),FCVector.vector2D(0,0),FCVector.vector2D(0,0)] for x in range(3)]

arrangeCubeMode = False
#Singleton Pattern
class Singleton(object):
    _instance = None
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs)

class AgentTreeNode:
    def __init__( self ):
	    self.Begin = 0
	    self.End = 0
	    self.Left = 0
	    self.MaxX = 0
	    self.MaxY = 0
	    self.MinX = 0
	    self.MinY = 0
	    self.Right = 0
	
class ObstacleTreeNode:
    def __init__( self ):
	    self.pObstacle = None
	    self.pLeft = None
	    self.pRight = None
	
class Line:
    def __init__( self ):
	    self.Point = FCVector.vector2D( 0, 0 )
	    self.Direction = FCVector.vector2D( 0, 0 )
	
class Wall:
    def __init__( self, _to, _from ):
        self.to = _to
        self.from_ = _from
        
        _temp =  FCVector.normalize( self.to - self.from_ )
        self.normal = FCVector.vector2D( -_temp.y, _temp.x )